<%--
  Created by IntelliJ IDEA.
  User: Aqqqwer
  Date: 2021/7/6
  Time: 18:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<style type="text/css">
    @import url("/css/header.css");
</style>
<head>
    <title>观看历史</title>
</head>
<script src="/js/jquery/jquery-3.3.1.js"></script>
<script>
    function exit() {
        $.ajax({
            url: '/user/exit',
            type: 'get',
            success: function () {
                alert('退出成功');
                window.location.href = "/user/login_user.jsp";
            },
            error: function () {
                alert('服务器异常');
            }
        });
    }
</script>
<body>
<header class="header">
    <h1><img style="height: 50px;width: 180px"
             src=""
             alt="">
    </h1>
    <form>
        <input type="text" name="search" placeholder="Search.." class="search">
    </form>
    <button class="searchButton searchButton2">立即搜索</button>
    <div class="login">
        <!-- 登录 -->
        <!-- 注册 -->
        <span><a href="login_user.jsp"><input type="button" class="dlspan" value="登 录"/></a></span>&nbsp;&nbsp;
        <span><a href="register_user.jsp"><input type="button" class="zcspan" value="注 册"/></a></span>
        <span><a><input type="button" class="dlspan" value="退出" onclick="exit()"/></a></span>
    </div>
</header>
<div class="topNav">
    <!-- 导航栏 -->
    <div style="float: left;">
        <button style="" class="links_button button dropdown">
            <a href="tuijian.jsp" style="text-decoration: none">推荐</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="yingshi.jsp" style="text-decoration: none">影视</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="yinyue.jsp" style="text-decoration: none">音乐</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="youxi.jsp" style="text-decoration: none">游戏</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="tiyu.jsp" style="text-decoration: none">体育</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="zongyi.jsp" style="text-decoration: none">综艺</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="yule.jsp" style="text-decoration: none">娱乐</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="dongman.jsp" style="text-decoration: none">动漫</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="shenghuo.jsp" style="text-decoration: none">生活</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="meishi.jsp" style="text-decoration: none">美食</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="chongwu.jsp" style="text-decoration: none">宠物</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
    </div>
</div>
<div class="img">
    <ul class="vertical">
        <li><a href="${pageContext.request.contextPath}/videos/queryHistory?userId=${param.id}"
               class="verticalLiA">观看历史</a></li>
        <li style="background-color: deepskyblue"><a
                href="${pageContext.request.contextPath}/user/user_center.jsp?id=${param.id}"
                class="verticalLiA">个人信息</a></li>
        <li><a href="#" class="verticalLiA">视频管理</a></li>
        <li><a href="#" class="verticalLiA">我的关注</a></li>
        <li><a href="#" class="verticalLiA">我的粉丝</a></li>
        <li><a href="${pageContext.request.contextPath}/user/update_password.jsp?id=${requestScope.users.id}"
               class="verticalLiA">修改密码</a></li>
    </ul>
    <div style="margin-left:15%;padding-top: 200px;height:1000px;white-space:nowrap;">
        <form class="row" style="margin-left: 100px" action="${pageContext.request.contextPath}/user/update"
              method="post">

            <c:choose>
                <c:when test="${requestScope.users==null}">
                    <span>加载数据发生异常</span>
                </c:when>
                <c:when test="${requestScope.users.id==null}">
                    <span>数据不存在</span>
                </c:when>
                <c:otherwise>
                    <p>头像:<img src="https://img2.baidu.com/it/u=1077360284,2857506492&fm=26&fmt=auto&gp=0.jpg"
                               style="width: 100px;height: 100px"></p>
                    <p>昵称:<label><input type="text" name="name" value="${requestScope.users.name}"></label></p>
                    <p>邮箱:<label><input type="email" name="email" value="${requestScope.users.email}"></label></p>
                    <p>手机号:<label><input type="text" name="phone" value="${requestScope.users.phone}"></label></p>
                    <p>年龄:<label><input type="text" name="age" value="${requestScope.users.age}"></label></p>
                    <p>性别:<label><input type="radio" name="sex"
                                        value="1" ${1==requestScope.users.sex?'checked':''}>男</label>
                        <label><input type="radio" name="sex"
                                      value="2" ${2==requestScope.users.sex?'checked':''}>女</label>
                    </p>

                    <input type="hidden" name="id" value="${requestScope.users.id}">
                    <button class="btn1" id="btn">保存</button>
                </c:otherwise>
            </c:choose>
        </form>
    </div>
</div>
</body>
</html>
